UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p7oYI9toRCE2g73dzx3dOIDlcy1Kt9dRtJ/npi5Rzso='
WHERE
key_id = 'e10078efe15e8c0e5d21dbaa542190a54b8aadfcf8b8380b47fd5ffee416bf57'
AND (
token = 'p7oYI9toRCE2g73dzx3dOIDlcy1Kt9dRtJ/npi5Rzso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)