UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pLjv/nHcxIO5cbAKrTzfl7GWDJKp+rVLQj5pHCT6u6Y='
WHERE
key_id = '59c3c84df9c41bfd615c683c1bfb0fd0b602bdfda791161252f3d1afd14503ce'
AND (
token = 'pLjv/nHcxIO5cbAKrTzfl7GWDJKp+rVLQj5pHCT6u6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)