UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBiU1d2fDuetTCiax2idV1es422ofsGQ6dmNW5hYBLM=' 
WHERE 
  key_id = '8ee1ee7fc385c262f5b2f04ab886a7691a9df513f488b8f1c777bdb6d91b7199' 
  AND (
    token = 'lBiU1d2fDuetTCiax2idV1es422ofsGQ6dmNW5hYBLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021