UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j6WVw4R1abOWJFldB7BY72zOdbooU2YnB5XlxI/AMGo='
WHERE
key_id = '3ef8756b08580660862033970226173fd6ef231123f15c20fed497f0d86ff4e9'
AND (
token = 'j6WVw4R1abOWJFldB7BY72zOdbooU2YnB5XlxI/AMGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)