UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ojB6qCd90q08mZGDWeZQywSDLNTI7/a+ZMVSjSQAKUQ='
WHERE
key_id = 'fdc6507434669b2043a63f0342f8af4d5ac9584f5ce19e49c6ba958def8a58d0'
AND (
token = 'ojB6qCd90q08mZGDWeZQywSDLNTI7/a+ZMVSjSQAKUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)