UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EgkijINg8pgg+jB4doT5UBzrzrvFRl5H2vLvaqNmpLg='
WHERE
key_id = 'af334cc886560a374e55a2a8b413c00ca13436e1e8fc129cf1da4287a4de2864'
AND (
token = 'EgkijINg8pgg+jB4doT5UBzrzrvFRl5H2vLvaqNmpLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)