UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FqAgA0zAq2WwEIlnadaqTCiQSSkoK/nt97m9YsOARP8='
WHERE
key_id = 'fdd2a3a8db9e2a3fa10ec4a7b5e577e3fed2b4f5236076901449833560cb7684'
AND (
token = 'FqAgA0zAq2WwEIlnadaqTCiQSSkoK/nt97m9YsOARP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)