UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iI1ZDcMEZr1zLYfpmkx/72gv9Xf0ExfXh2G21/uluxA='
WHERE
key_id = 'e25d836311612d93871a41f2b18869573779e0ee5143d784d43336432d2cce62'
AND (
token = 'iI1ZDcMEZr1zLYfpmkx/72gv9Xf0ExfXh2G21/uluxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)