UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZUduAeMkPK6SI4PzPmZZ+1HNFFTyExArwyU8OxuooRw=' 
WHERE 
  key_id = '7d1041257fff2130c30b9d6326412d17dd8f52e0f6321aaab2caede3937b33b6' 
  AND (
    token = 'ZUduAeMkPK6SI4PzPmZZ+1HNFFTyExArwyU8OxuooRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015