UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MnbB4NqezUxgQ5NIAASl//fGQ5Mi171CxiveERAM150='
WHERE
key_id = 'ea76227241bda0a5f21689cb57001890d6e9a778e1f0882a57dae31a683e3d93'
AND (
token = 'MnbB4NqezUxgQ5NIAASl//fGQ5Mi171CxiveERAM150='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)