UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Y+mms9gclr4eNwJ/hR10BbvEAim5WZxPDJAqxz9ZaI='
WHERE
key_id = '2a47ec42a8bfeade1d72f6d6cac175cb63e225e7194b8ed5f890442899fbe425'
AND (
token = '3Y+mms9gclr4eNwJ/hR10BbvEAim5WZxPDJAqxz9ZaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)