UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6XCjEUMLMaqt3ncwyf5FEVbSJzthpLj8m3aB5fuj48='
WHERE
key_id = '3ceb8fc423af5a667fc67aa50c1757cb921b88de1122a2781e899017252e63fc'
AND (
token = 'F6XCjEUMLMaqt3ncwyf5FEVbSJzthpLj8m3aB5fuj48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)