UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nT86SfmY1n+0XiXggrBOOb+Z3fw+CzY4UMIJlPgZj2I='
WHERE
key_id = 'ee964568c4248fc1c54036d6823f005c07f56c50f68c13237da6f44621e28856'
AND (
token = 'nT86SfmY1n+0XiXggrBOOb+Z3fw+CzY4UMIJlPgZj2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)