UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BkQgoIuLB9souFY0TQzd/wD6uhyzy8lY1B9Rw5v4lL0=' 
WHERE 
  key_id = '42b47be6c3dbe53fa79ed4b62450fb8610d2c00231e01a7a454bb0c8afee88a8' 
  AND (
    token = 'BkQgoIuLB9souFY0TQzd/wD6uhyzy8lY1B9Rw5v4lL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036