UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qgC4cJXm9UQ+6+6U8lVcR1/QLbLQfDyJZ69gwPLav60='
WHERE
key_id = '0caedd858b26a5186052117143f5bd9258787848608712e3a945729a55ce270d'
AND (
token = 'qgC4cJXm9UQ+6+6U8lVcR1/QLbLQfDyJZ69gwPLav60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)