UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HcUK/weOQfvtwPESKbhu57ECmqawA3CYdo3f8PAtNm0=' 
WHERE 
  key_id = '0bb35c4c331f1ea162437a65d7ccbc60c63f9f9505ab0946bfed92b1a89912e1' 
  AND (
    token = 'HcUK/weOQfvtwPESKbhu57ECmqawA3CYdo3f8PAtNm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029