UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uu0zvSSkYhp5AVCwRpmwu2TkfUXhHP5n7hS7+prsv6c='
WHERE
key_id = 'e9b873dffce52f3748e2582c748a002edd5b82d61e157420f39297c8fc352a12'
AND (
token = 'uu0zvSSkYhp5AVCwRpmwu2TkfUXhHP5n7hS7+prsv6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)