UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBi3bZGE3WSt6o3lU4OJZnXBHYgf9d2GDQlWb+XFevY='
WHERE
key_id = 'c26e049f4b1a086461765ba803017e02e63b6dade0520adb0151699d329e93fa'
AND (
token = 'uBi3bZGE3WSt6o3lU4OJZnXBHYgf9d2GDQlWb+XFevY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)