UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5+bm1meRCdOVTj+tXI3I4p5xRhePy/4QUUVm793DwSY=' 
WHERE 
  key_id = '02a8febce8076790624b3903e3cb8f0e461c6bedb8379a2b10c619257b830b33' 
  AND (
    token = '5+bm1meRCdOVTj+tXI3I4p5xRhePy/4QUUVm793DwSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034