UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DEaV0i3Gf+JRl2r8Zct9WUBDHWESf3lcPGX6X5P5oag=' 
WHERE 
  key_id = 'abc1d2de828e3d081ebbb5190e1575665cd5f6c85aa2d4e1f208f01f7a9f8f13' 
  AND (
    token = 'DEaV0i3Gf+JRl2r8Zct9WUBDHWESf3lcPGX6X5P5oag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024