UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WGJhsoIhPff6Jfy7PTDapdq8284pqB8lrKwX/DzSy5o='
WHERE
key_id = 'c75a768290e068e6f04dccbf41577e906ed767dd17d4cae0708ea63b2b5f9ecd'
AND (
token = 'WGJhsoIhPff6Jfy7PTDapdq8284pqB8lrKwX/DzSy5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)