UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YTOnnVMfNAx1pZvNS5LeAJ2Vggk69LqKlWKYC3G/V3Y='
WHERE
key_id = '537dd02c82f0daeff037c75f48eecce05c23cd64f5ee395b344dcfd5be45f8a0'
AND (
token = 'YTOnnVMfNAx1pZvNS5LeAJ2Vggk69LqKlWKYC3G/V3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)