UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yo0NRm8UCb/rxQC1iERbk6bxG3u63B2ZC/bpj5spZVw=' 
WHERE 
  key_id = 'fbe0c66dda40adc164ea7f7b86bcf4f2f09cbbf813b45beee0507aa981955134' 
  AND (
    token = 'Yo0NRm8UCb/rxQC1iERbk6bxG3u63B2ZC/bpj5spZVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028