UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eNIhT9+FPOCp1tMjZuacBX19Een6B2+YLx8vULZItKQ='
WHERE
key_id = '3400a05c84616c020e076041f2f52f048e5e91d38aa11525c1eea5d61816cff3'
AND (
token = 'eNIhT9+FPOCp1tMjZuacBX19Een6B2+YLx8vULZItKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)