UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P4XU/jdtsiAyDgxPd4yaXNdaAWYtny7TdT7s4UXDdEA=' 
WHERE 
  key_id = '0d1569f0c7379585ae99a12a687a5fdf07cefe53c204bb9f75b533481bea4a0f' 
  AND (
    token = 'P4XU/jdtsiAyDgxPd4yaXNdaAWYtny7TdT7s4UXDdEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039