UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P5jA1icyG9J/krQJqPoh+37/b0CpeBf+aB6TzL6qUgI='
WHERE
key_id = 'c306b2d671880803d69e876cfb38184691f42a2ea9bf3a2c80f37fa8000595b5'
AND (
token = 'P5jA1icyG9J/krQJqPoh+37/b0CpeBf+aB6TzL6qUgI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)