UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r1cZJ7yc8xeW5lZshhOpgqQlalJHsXvyyaWRoXP/GQg='
WHERE
key_id = '2ecf460897822818b0f4454ffe7937ce16a432218d956d7ee227f53e673f3993'
AND (
token = 'r1cZJ7yc8xeW5lZshhOpgqQlalJHsXvyyaWRoXP/GQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)