UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KhF0RgZfDHTxrS6CSi1iAfVUyai6EITj/kfmcSXCaog='
WHERE
key_id = '19325088aa43ab2d59f9d9c4d3967e84a888add697d0e810896be5a68a663a15'
AND (
token = 'KhF0RgZfDHTxrS6CSi1iAfVUyai6EITj/kfmcSXCaog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)