UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MNOkunbzR9loRw1xnPVr9aWRXoNSygLs2cCNtdyorcM=' 
WHERE 
  key_id = 'ef9e21b77548e3b971a8e6ffa192969e54624b6ef0a87ad7eb9234bf36a590b9' 
  AND (
    token = 'MNOkunbzR9loRw1xnPVr9aWRXoNSygLs2cCNtdyorcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029