UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SZDvm0rqiGEBmxfMoq8y5R9ZExrZkDN8scZk9EGVRj0='
WHERE
key_id = '25f926478edf186a391512c76287cc29313b082f36d20f0e3de6e65457033875'
AND (
token = 'SZDvm0rqiGEBmxfMoq8y5R9ZExrZkDN8scZk9EGVRj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)