UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RWykbDDIjkULvng4EZkUecV+Z/d7op7UgbZSIQRL+vU=' 
WHERE 
  key_id = '05606751e0b06961017763e9ff988793957018ae5d9fccbc77e313e237241063' 
  AND (
    token = 'RWykbDDIjkULvng4EZkUecV+Z/d7op7UgbZSIQRL+vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056