UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xZR2oy+Ld1d0sDqe47RjhEnm7H5400rnQzbRMRoyJWU=' 
WHERE 
  key_id = 'cf514dd45ced87ef1b4c49c294c50d05fe185373585944fcb58dfc4cc79d1c89' 
  AND (
    token = 'xZR2oy+Ld1d0sDqe47RjhEnm7H5400rnQzbRMRoyJWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015